import 'package:flutter/material.dart';
import 'package:flutter_audit_app/res/strings.dart';
import 'package:flutter_audit_app/widgets/icon_label.dart';
import 'package:flutter_audit_app/widgets/label_value.dart';

///  项目名称：flutter_audit_app
///  Created by leon on 2020/08/23 .

///  个人基本信息
///
class PersonBaseInfoPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _BaseInfoState();
}

class _BaseInfoState extends State<PersonBaseInfoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Container(
          padding: EdgeInsets.only(left: 20, right: 20, top: 5),
          child: Wrap(
            direction: Axis.horizontal,
            children: [
              _buildIconLabel(Strings.resumeTxt),
              _buildResumeWidget(),
              _buildIconLabel(
                Strings.staffLocationTxt,
                iconPath: 'assets/images/icon_workers.png',
              ),
            ],
          ),
        ),
      ),
    );
  }

  ///title+icon
  Widget _buildIconLabel(String labelText,
      {String iconPath = 'assets/images/icon_resume.png'}) {
    return IconLabel(
      iconPath: iconPath,
      labelText: labelText,
      rightIconMark: 'assets/images/img_mark.png',
    );
  }

  Widget _buildResumeWidget() {
    return Container(
      padding: EdgeInsets.only(top: 5, right: 30, bottom: 5),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Expanded(
            child: Column(
              children: <Widget>[
                LabelValue(Strings.nameTxt, value: '张它它'),
                LabelValue(Strings.ageTxt, value: '41'),
                LabelValue(Strings.companyNameTxt, value: '银豆公司'),
              ],
            ),
          ),
          Expanded(
            child: Column(
              children: <Widget>[
                LabelValue(Strings.genderTxt, value: '男'),
                LabelValue(Strings.contactAddressTxt, value: '北京市海淀区四季酒店'),
                LabelValue(Strings.insuranceTypeTxt, value: '职工医保'),
              ],
            ),
          ),
          Expanded(
            child: Column(
              children: <Widget>[
                LabelValue(Strings.idCardTxt, value: '420280198012036520'),
                LabelValue(Strings.retirementSignTxt, value: '内退'),
                LabelValue(Strings.insuredPlaceTxt, value: '北京高-海淀区'),
              ],
            ),
          ),
          Image.asset('assets/images/img_avatar.png'),
        ],
      ),
    );
  }

  Widget _lWidget() {
    return Container(
      child: Wrap(
        children: <Widget>[
          IconLabel(
            iconPath: 'assets/images/icon_resume.png',
            labelText: '人员基本信息',
            rightIconMark: 'assets/images/img_mark.png',
          ),
          IconLabel(
            iconPath: 'assets/images/icon_workers.png',
            labelText: '职工居民选定点情况',
            rightIconMark: 'assets/images/img_mark.png',
          ),
          Container(
            padding: EdgeInsets.only(top: 5, right: 30, bottom: 10),
            /*child: Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Expanded(
                  child: Container(
                    margin: EdgeInsets.only(left: 20, top: 5),
                    decoration: loginInputBorder(),
                    child: ListTile(
                      leading:
                          Image.asset('assets/images/2.0x/img_hospital1.png'),
                      title: Text(
                        '定点医院一',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(color: Color(u_78899c), fontSize: 10),
                      ),
                      subtitle: Text(
                        '海淀区一季城医院',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(color: Color(u_2196f3), fontSize: 12),
                      ),
                    ),
                  ),
                ),
                Expanded(
                  child: Container(
                    margin: EdgeInsets.only(left: 20, top: 5),
                    decoration: loginInputBorder(),
                    child: ListTile(
                      leading:
                          Image.asset('assets/images/2.0x/img_hospital2.png'),
                      title: Text(
                        '定点医院二',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(color: Color(u_78899c), fontSize: 10),
                      ),
                      subtitle: Text(
                        '海淀区二季城医院',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(color: Color(u_2196f3), fontSize: 12),
                      ),
                    ),
                  ),
                ),
                Expanded(
                  child: Container(
                    margin: EdgeInsets.only(left: 20, top: 5),
                    decoration: loginInputBorder(),
                    child: ListTile(
                      leading:
                          Image.asset('assets/images/2.0x/img_hospital3.png'),
                      title: Text(
                        '定点医院三',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(color: Color(u_78899c), fontSize: 10),
                      ),
                      subtitle: Text(
                        '海淀区三季城医院',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(color: Color(u_2196f3), fontSize: 12),
                      ),
                    ),
                  ),
                ),
                Expanded(
                  child: Container(
                    margin: EdgeInsets.only(left: 20, top: 5),
                    decoration: loginInputBorder(),
                    child: ListTile(
                      leading:
                          Image.asset('assets/images/2.0x/img_hospital4.png'),
                      title: Text(
                        '定点医院四',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(color: Color(u_78899c), fontSize: 10),
                      ),
                      subtitle: Text(
                        '海淀区四季城医院',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(color: Color(u_2196f3), fontSize: 12),
                      ),
                    ),
                  ),
                ),
              ],
            ),*/
          ),
          IconLabel(
            iconPath: 'assets/images/icon_rescue.png',
            labelText: '救助特困信息',
            rightIconMark: 'assets/images/img_mark.png',
          ),
          IconLabel(
            iconPath: 'assets/images/icon_approval.png',
            labelText: '审批信息',
            rightIconMark: 'assets/images/img_mark.png',
          ),
          Container(
            padding: EdgeInsets.only(top: 5, right: 30, bottom: 10),
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Expanded(
                  child: Column(
                    children: <Widget>[
                      LabelValue('门诊/门慢统筹限额:', value: '5000元'),
                      LabelValue('门特统筹限额:', value: '3000元'),
                      LabelValue('门诊单病种通过病种名称:', value: '银豆公司'),
                    ],
                  ),
                ),
                Expanded(
                  child: Column(
                    children: <Widget>[
                      LabelValue('特药:', value: '敌敌畏'),
                      LabelValue('门诊/门慢还可以享受金额:', value: '2000元'),
                    ],
                  ),
                ),
                Expanded(
                  child: Column(
                    children: <Widget>[
                      LabelValue('门特还可享受金额:', value: '1000元'),
                      LabelValue('门诊单病种待遇限额:', value: '2000元'),
                    ],
                  ),
                ),
              ],
            ),
          ),
          IconLabel(
            iconPath: 'assets/images/icon_rescue.png',
            labelText: '直系家庭成员信息',
            rightIconMark: 'assets/images/img_mark.png',
          ),
        ],
      ),
    );
  }

/*Widget _hospitalImg(
      {@required String imgPath,
      String title,
      String subTitle,
      double left = 20.0}) {
    return Container(
      margin: EdgeInsets.only(left: left, top: 5),
      decoration: loginInputBorder(),
      child: ListTile(
        leading: Image.asset(imgPath),
        title: Text(
          title,
          overflow: TextOverflow.ellipsis,
          style: TextStyle(color: Color(u_78899c), fontSize: 10),
        ),
        subtitle: Text(
          subTitle,
          overflow: TextOverflow.ellipsis,
          style: TextStyle(color: Color(u_2196f3), fontSize: 12),
        ),
      ),
    );
  }*/
}
